Next | Prev | Up | Top | Contents | Index

Building a Shared Library Using Versioning

Follow these instructions when building your shared library:

When you first build your shared library, give it an initial version, for example, sgi1.0. Add the option -set_version sgi1.0 to the command to build your shared library (cc -shared, ld -shared).

Whenever you make a compatible change to the shared object, create another version by changing the minor version number (for example, sgi1.1) and add it to the end of the version_string. The command to set the version of the shared library now looks like -set_version "sgi1.0:sgi1.1".

When you make an incompatible change to the shared object:

  1. Change the filename of the old shared object by adding a dot followed by the major number of one of the versions to the filename of the shared object. Do not change the soname of the shared object or its contents. Simply rename the file.

  2. Update the major version number and set the version_string of the shared object (when you create it) to this new version; for example, -set_version sgi2.0.
This versioning mechanism affects executables in the following ways:


Next | Prev | Up | Top | Contents | Index